package com.nyist.zk.service.impl;

import com.nyist.zk.dao.BloodDao;
import com.nyist.zk.entities.Blood;
import com.nyist.zk.service.BloodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.beans.Transient;
import java.util.List;

@Service
public class BloodServiceImpl implements BloodService {

    @Autowired
    private BloodDao bloodDao;

    @Override
    @Transient
    public void insertBlood(Blood blood) {
        bloodDao.insertBlood(blood);
    }

    @Override
    @Transient
    public void deleteByTypeAndSourceBlood(String b_type, String b_source) {
        bloodDao.deleteByTypeAndSourceBlood(b_type, b_source);
    }

    @Override
    @Transient
    public void updateBlood(Blood blood) {
        bloodDao.updateBlood(blood);
    }

    @Override
    public List<Blood> findAllBlood() {
        return bloodDao.findAllBlood();
    }

    @Override
    public Blood findByTypeBlood(String b_type) {
        return bloodDao.findByTypeBlood(b_type);
    }

    @Override
    public List<Blood> findBySourceBlood(String b_source) {
        return bloodDao.findBySourceBlood(b_source);
    }

}
